#pragma config(Motor,  port2,           MR,    tmotorServoContinuousRotation, openLoop)
#pragma config(Motor,  port3,           ML,     tmotorServoContinuousRotation, openLoop, reversed)

bool X = true;
bool Y = true;

task main()
{

	while(true)
	{
		// Check for toggle
		if(vexRT[Btn8D] == 1 && Y == true)
		{
			X = !X;
			Y = false;
		}else if( vexRT[Btn8D] == 0)
		{
			Y = true;
		}
		// Joystick controll
		if(X == true)
		{
			motor[MR] = vexRT[Ch2];
			motor[ML] = vexRT[Ch3];
		}else
		{
			// bumper control
			if(vexRT[Btn6U] == 1)
			{
				motor[MR] = 127;
			}else if(vexRT[Btn6D] == 1)
			{
				motor[MR] = -127;
			}else
			{
				motor[MR] = 0;
			}
			if(vexRT[Btn5U] == 1)
			{
				motor[ML] = 127;
			}else	if(vexRT[Btn5D] == 1)
			{
				motor[ML] = -127;
			}else
			{
				motor[ML] = 0;
			}
		}
	}
}
